// 2013-9-26上午01:12:36  net.betou.trade.entity.main.base.BaseShare.java

package net.betou.trade.entity.main.base;

import java.io.Serializable;

import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.entity.main.Role;
import net.betou.trade.entity.main.Share;

/**
 * 
 * @author 叶装装
 */
public class BaseShare implements Serializable{
	
	private Integer id; 
	
	private AgentAndAdmins admin; // 删除一个admin的时候，应该删除全部所有的数据
	private Role role;             // 删除一个角色的时候，也应该删除该表中对应的数据
	private String item;   // 共享项,有多个
	
	public BaseShare( ){
		
	}
	

	private int hashCode = Integer.MIN_VALUE;

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}
	
	public boolean equals( Object obj ) {
		if( null == obj )
			return false;
		if( !( obj instanceof Share ) )
			return false;
		else{
			Share share = ( Share ) obj;
			if( null == this.getId( ) || null == share.getId( ) )
				return false;
			else
				return( this.getId( ).equals( share.getId( ) ) );
		}
	}
	
	public Integer getId( ) {
		return id;
	}

	public void setId( Integer id ) {
		this.id = id;
	}

	public AgentAndAdmins getAdmin( ) {
		return admin;
	}

	public void setAdmin( AgentAndAdmins admin ) {
		this.admin = admin;
	}

	public Role getRole( ) {
		return role;
	}

	public void setRole( Role role ) {
		this.role = role;
	}

	public String getItem( ) {
		return item;
	}

	public void setItem( String item ) {
		this.item = item;
	}



	private static final long serialVersionUID = 1190648643982973983L;

}
